import { Injectable } from '@angular/core';
import { APIBase } from 'app/modules/base/api-base';
import { HttpClient } from '@angular/common/http';

@Injectable({
	providedIn: 'root',
})
export class DepartmentService extends APIBase<DepartmentW, Department> {
	constructor(private http: HttpClient) {
		super(http, '/api/admin/department');
	}
}
interface DepartmentW {
	id?: number;
	name: string;
	des: string;
	parent_level_struct?: string;
}
export interface Department {
	id: number;
	level_struct: string;
	name: string;
	des: string;
	// edit template
	children?: Department[];
	editing?: boolean;
}
